<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>


<title></title>
</head>
<body>
<div class="ibox-content">
	<form class="form-horizontal" id="dataform"
		onsubmit="javascripr:return false;">

		<input type="hidden" name="tokenUrl" value="${tokenUrl}"> 
		<input type="hidden" name="token" value="${token}">

		<c:if test="${obj ne null }">
			<input type="hidden" name="stuId" value='<c:out value="${obj.stuId}"></c:out>'>
		</c:if>
		
		<div class="form-group">
			<label class="col-sm-2 control-label">学生姓名<span class="red">*</span></label>
			<div class="col-sm-4">
				<input type="text" name="stuName" value="${obj.stuName}"
					class="form-control radius"  
					datatype="*1-20" nullmsg="学生不能为空" >
				<div class="Validform_checktip"></div>
			</div>
			
			<label class="col-sm-2 control-label">院校<span class="red">*</span></label>
			<div class="col-sm-4">
				<select name="stuSchool" class="form-control autoFull select2"
					data-url="${path}/admin/studentinfo/showAllSchool"
					data-def="${obj.stuSchool }"
					data-filed="name" data-value="name"
					datatype="*" nullmsg="院校不能为空">
					<option value="">--请选择所属院校--</option>
				</select>
				<div class="Validform_checktip"></div>
			</div>
		</div>	
		
		<div class="form-group">	
			<label class="col-sm-2 control-label">是否院校毕业<span class="red">*</span></label>
			<div class="col-sm-4">
				<input type="text"  class="form-control"
					value="${obj.stuIfschool}" name="stuIfschool" placeholder="请填是或者否"
					datatype="*" nullmsg="不能为空">
				<div class="Validform_checktip"></div>
			</div>
		
			<label class="col-sm-2 control-label">班级<span class="red">*</span></label>
			<div class="  col-sm-4">
				<select name="stuClass" class="form-control autoFull select2"
					data-url="${path}/admin/tabClass/showAllClass"
					data-def="${obj.stuClass }"
					data-filed="claName" data-value="claId"
					datatype="*" nullmsg="班级不能为空">
					<option value="">--请选择所在班级--</option>
				</select>
				<div class="Validform_checktip"></div>
			</div>
		</div>	
		
		<div class="form-group">
			<label class="col-sm-2 control-label">课程<span class="red">*</span></label>
			<div class="  col-sm-4">
				<select name="stuCourse" class="form-control autoFull select2"
					data-url="${path}/admin/course/showAllCourse"
					data-def="${obj.stuCourse }"
					data-filed="couName" data-value="couId"
					datatype="*" nullmsg="课程不能为空">
					<option value="">--请选择课程--</option>
				</select>
				<div class="Validform_checktip"></div>
			</div>
			
			<label class="col-sm-2 control-label">学费标准<span class="red">*</span></label>
			<div class="col-sm-4">
				<input type="text" id="stuTuition" name="stuTuition" value="${obj.stuTuition}"
					class="form-control radius" 
					datatype="price" nullmsg="学费不能为空">
				<div class="Validform_checktip"></div>
			</div>
		</div> 
		
		<div class="form-group">
			<label class="col-sm-2 control-label  ">缴费方式<span class="red">*</span></label>
			<div class="  col-sm-4">
				<select name="stuMode" class="form-control autoFull select2"
					data-url="${path}/admin/studentinfo/showAllPay"
					data-def="${obj.stuMode }"
					data-filed="name" data-value="name"
					datatype="*" nullmsg="缴费方式不能为空">
					<option value="">--请选择缴费方式--</option>
				</select>
				<div class="Validform_checktip"></div>
			</div>
			
			<label class="col-sm-2 control-label  ">优惠金额<span class="red">*</label>
			<div class="  col-sm-4">
				<input type="text" class="form-control" maxlength="8"
					value="${obj.stuPmoney }" name="stuPmoney" placeholder="没有请填写0"
					datatype="price" nullmsg="优惠金额不能为空" 
					>
				<div class="Validform_checktip"></div>
			</div>
		</div>	
		
		<div class="form-group">
			<label class="col-sm-2 control-label">优惠原因<span class="red">*</label>
			<div class="col-sm-4">
				<input type="text"  class="form-control"
					value="${obj.stuCause}" name="stuCause" placeholder="没有请填写无"
					datatype="*" nullmsg="优惠原因不能为空">
				<div class="Validform_checktip"></div>
			</div>
			
			<label class="col-sm-2 control-label">入学时间<span class="red">*</span></label>
			<div class="col-sm-4">
				<input name="stuDate" type="text" datatype="*"
					class="form-control  datetimepicker" 
					style=" display: inline;" 
					value='<fmt:formatDate value="${obj.stuDate}" pattern="yyyy-MM-dd"/>' >
				<div class="Validform_checktip"></div>
			</div>
		</div>	
			
		<div class="form-group">	
			<label class="col-sm-2 control-label  ">状态<span class="red">*</span></label>
			<div class="col-sm-4">
				<select name="stuStatus" class="form-control autoFull select2"
					data-url="${path}/admin/studentinfo/showStuStatus"
					data-def="${obj.stuStatus }"
					data-filed="name" data-value="name"
					datatype="*" nullmsg="状态不能为空">
					<option value="">--请选择状态--</option>
				</select>
				<div class="Validform_checktip"></div>
			</div>
			
			<label class="col-sm-2 control-label">备注</label>
			<div class="col-sm-4">
				<textarea rows="6" cols="" class="form-control" name="stuRemark" 
							datatype="*0-15" 
					>${obj.stuRemark }</textarea>
				<div class="Validform_checktip"></div>
			</div>
		</div>
		
		
		
		<div class="form-group ">
			<div class="col-sm-12 text-center">
				<a href="javascript:;" onclick="myForm.submit()"
					class="btn btn-success radius">保存</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<button onclick="MTools.closeForm()" class="btn btn-danger radius"
					type="button">取消</button>
			</div>
		</div>
	</form>
</div>
</body>
<script type="text/javascript">
	
	var myForm;
	$(function(){
		//带搜索的下拉框
		$(".select2").select2({'width':'100%'});
		$(".select2").trigger("blur");
		//初始化下拉框
		MTools.autoFullSelect();
		//初始化日期控件
		MTools.ininDatetimepicker({
			listenBlur : true
		});
		myForm = MForm.initForm({
			invokeUrl : "${path}/admin/studentinfo/addOrModify",
			afterSubmit : function() {
				parent.myGrid.serchData();
			},
		});		
	});
	
	/* function checkName(){
	} */
	
	$('.select2').change(function() {
		if(this.value != "") {
			$(this).parent().children('.Validform_checktip').text('');
			$(this).parent().children('.Validform_checktip').removeClass('Validform_wrong');
			$(this).parent().children('.Validform_checktip').addClass('Validform_right');
		}
	})
</script>
</body>
</html>